<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="jquery-3.7.1.js"></script>
</head>
<body>
    <script>
        let aa = 10;
        // console.log(typeof aa);// number

        // let bb = "hello"
        // console.log(typeof bb);  //string

        // let cc;
        // console.log(typeof cc);  //undefined

        // let dd = true;
        // console.log(typeof dd); //boolean

        // console.log("5/2=" + (5/2));

        let ee = "10";

        // == 表示值相等，不考虑类型是否相同 ，=== 表示值和类型都相等
        console.log("aa==ee:"+ (aa==ee));  //true
        console.log("aa===ee:"+ (aa===ee)); //false


        //数组
        // let arr = new Array();
        let arr2 = [];
        // let arr3 = [1, 2, "e", "apple", true];
        // console.log(typeof arr3); //打印arr3类型
        // console.log(arr3); //打印arr3
        
        //增删改查
        // arr2[0] = "aa";
        // arr2[1] = "bb";
        // arr2[5]= "cc";
        // arr2["hello"] = "array";
        // arr2[-3] = "-3"

        console.log(arr2); //打印arr2
        // 修改
        arr2[5] = "ee";
        console.log(arr2); //打印arr2

        //查
        // console.log(arr3[3]);
        //删
        // arr3.splice(2, 2);
        // console.log(arr3); //打印arr3


        //函数定义
        // function hello(){
        //     console.log("hello hello!");
        // }
        // // hello(); //函数调用

        // function add (x,y){
        //     let sum = x+y;
        //     console.log(x +"+"+y+"="+sum);
        //     return sum;
        // }
        // add(5,3);
        // add("aa",3);
        // add("aa","bb");
        // add("aa");
        // add("aa","bb","cc");
        // add(5);

        // let sum= add(5,3);
        // console.log(sum);

        // let sum = function (x,y){
        //     return x+y;
        // }
        // console.log(typeof sum); //function
        // console.log(sum(6,7));  //13
        
        //对象相关
        // let obj = {};
        //  //属性赋值
        // obj.name = "lisi";
        // obj.age = 15;
        // obj['gender'] = "男";
        // //属性修改
        // obj.age=17;
        // obj['name']="wangwu";
        // console.log(obj);



        let obj2 = new Object();
        console.log(obj2);
        
        let stu = {
            "id": 5,
            "name":"zhangsan",
            "age":18
        };

        console.log(typeof stu + 111);
        stu['gender']="女";
        // stu.gender= "男";
        console.log(stu);

        function Cat(age, color, name){
            this.age = age;
            this.color = color;
            this.name = name;
        }

        let xiaohuang = new Cat(1, "yellow", "xiaohuang");
        console.log(xiaohuang);
    </script>
</body>
</html>